<?php
namespace app\common\repositories\lawyer;
use app\common\repositories\BaseRepository;
use app\common\dao\lawyer\LawyerDao as dao;
/**
 * @mixin dao
 */
class LawyerRepository extends BaseRepository
{
    public function __construct(dao $dao)
    {
        $this->dao = $dao;
    }


    public function getList($where,$page,$limit)
    {
        $where['status'] = 1;
        $count = $this->dao->search($where)->count();
        $list = $this->dao->search($where)->append(['city'])->page($page,$limit)->order('recommend desc')->select();
        return compact('count','list');
    }


    public function getAdminLst($where,$page,$limit)
    {
        $count = $this->dao->search($where)->count();
        $list = $this->dao->search($where)->append(['city'])->page($page,$limit)->order('recommend desc')->select();
        return compact('count','list');
    }


    public function mainDoList()
    {
        return [
            '婚姻家庭','交通事故','劳动人事','民间借贷','房屋买卖','医疗纠纷','侵权损害','人格权纠纷','物权纠纷','综合','合同纠纷','建设工程','金融借款','知识产权'
        ];
    }
}